<template>
  <div>
      <el-table
      :data="seckArr"
      style="width: 100%">
      <el-table-column
        prop="title"
        label="活动名称"
        width="180">
      </el-table-column>
      <el-table-column
        prop="status"
        label="状态"
        width="180">
        <template slot-scope="obj">
          <el-tag v-show="obj.row.status == 1">启用中</el-tag>
          <el-tag v-show="obj.row.status == 2" type="danger">已禁用</el-tag>
        </template>
      </el-table-column>
      <el-table-column
        label="操作">
        <template slot-scope="obj">
           <el-button type="primary" icon="el-icon-edit" circle @click="updataSeck(obj.row.id)"></el-button>
             <el-button type="danger" icon="el-icon-delete" circle @click="delSeck(obj.row.id)"></el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { successMsg, failedMsg } from "../../tools/tools.js";
import {seckdelete} from '../../request/api.js'
export default {
  props:['seckArr'],
  methods: {
    updataSeck(id){
      this.$emit('updataSeck',id)
    },
    delSeck(id){
      seckdelete({id}).then(d=>{
        if(d.data.code == 200){
          successMsg('删除成功')
          this.$emit('delSeck')
        }else{
          failedMsg('删除失败')
        }
      })
    }
  },
}
</script>

<style>

</style>